package com.ymt.consumer.dao.impl;

import com.ymt.consumer.dao.FinancialReceiptsMapper;
import com.ymt.consumer.domain.FinancialReceipts;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class FinancialReceiptsMapperImpl implements FinancialReceiptsMapper {
    public static final String INSERT = "com.ymt.consumer.dao.FinancialReceiptsMapper.insert";
    public static final String COUNTBYORDERCODE = "com.ymt.consumer.dao.FinancialReceiptsMapper.countByOrderCode";

    @Autowired
    private SqlSessionTemplate sqlSession;

    @Override
    public Integer insert(FinancialReceipts financialReceipts) {
        return this.sqlSession.insert(INSERT, financialReceipts);
    }

    @Override
    public Long countByOrderCode(String orderCode) {
        return this.sqlSession.selectOne(COUNTBYORDERCODE,orderCode);
    }
}
